]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
[Overview] Fix click handling of open panes
authorFlorian Müllner <fmuellner@src.gnome.org>
Wed, 3 Mar 2010 23:10:16 +0000 (00:10 +0100)
committerFlorian Müllner <fmuellner@src.gnome.org>
Sun, 7 Mar 2010 22:53:06 +0000 (23:53 +0100)
The top part of the application pane closes the pane, while outside
the menu only the workspace area accepts clicks for closing the pane.
Let the user close the pane by clicking anywhere outside the menu, but
not inside.

https://bugzilla.gnome.org/show_bug.cgi?id=611641

js/ui/appDisplay.js
js/ui/overview.js

index f18745f6c18ddfb2737cb53700ac5c7435e4973c..7ae0b08f08655e1734fe05944d2d98882e8c9513 100644 (file)
@@ -87,7 +87,8 @@ AllAppDisplay.prototype = {
             Main.queueDeferredWork(this._workId);
         }));
 
-        let bin = new St.BoxLayout({ style_class: 'all-app-controls-panel' });
+        let bin = new St.BoxLayout({ style_class: 'all-app-controls-panel',
+                                     reactive: true });
         this.actor = new St.BoxLayout({ style_class: 'all-app', vertical: true });
         this.actor.hide();
 
index 1f2ca9bf29d7602081983eab6523cfec11798204..1f0ee4b9ab2192bbe90086fe3b91ca90ed2b9aa8 100644 (file)
@@ -372,9 +372,8 @@ Overview.prototype = {
             }));
         }
 
-        this._transparentBackground.set_position(this._paneContainer.x, this._paneContainer.y);
-        this._transparentBackground.set_size(primary.width - this._paneContainer.x,
-                                             this._paneContainer.height);
+        this._transparentBackground.set_position(primary.x, primary.y);
+        this._transparentBackground.set_size(primary.width, primary.height);
 
     },
 
@@ -391,10 +390,17 @@ Overview.prototype = {
                 this._transparentBackground.raise_top();
                 this._paneContainer.raise_top();
                 this._paneContainer.show();
+                this._paneReady = false;
                 if (backgroundEventId != null)
                     this._transparentBackground.disconnect(backgroundEventId);
-                backgroundEventId = this._transparentBackground.connect('button-release-event', Lang.bind(this, function () {
-                    this._activeDisplayPane.close();
+                backgroundEventId = this._transparentBackground.connect('captured-event', Lang.bind(this, function (actor, event) {
+                    if (event.get_source() != this._transparentBackground)
+                        return false;
+                    if (event.type() == Clutter.EventType.BUTTON_PRESS)
+                        this._paneReady = true;
+                    if (event.type() == Clutter.EventType.BUTTON_RELEASE
+                        && this._paneReady)
+                        this._activeDisplayPane.close();
                     return true;
                 }));
                 this._workspaces.actor.opacity = 64;